package com.tools.web.email.template;

import com.tools.common.object.Note;

/**
 * 邮箱模板包装类
 * 对应路径是 classpath:template/email/EmailTemplate1.html
 * */
@Note("邮箱模板的默认包装类。" +
        "对应路径是 classpath:template/email/EmailTemplate1.html")
public class EmailCaptchaTemplate1 {

    public static final String T1 = "<!DOCTYPE html><html><head><meta charset=\"UTF-8\"><meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">" +
            "<style>" +
            "body {font-family: Arial, sans-serif;margin: 0;padding: 0;background-color: #f4f4f4;}" +
            ".container {max-width: 600px;margin: 0 auto;padding: 20px;background-color: #fff;box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);margin-top: 100px;}" +
            "h1 {color: #3498db;text-align: center;}" +
            "h2 {color: #333;text-align: center;}" +
            "p {color: #666;text-align: center;margin-bottom: 10px;}" +
            ".code-container {text-align: center;margin-top: 20px;}" +
            ".code {font-size: 24px;font-weight: bold;color: #3498db;border: 2px solid #3498db;padding: 10px 20px;display: inline-block;}" +
            ".info {font-size: 10px;color: #777;}" +
            ".f-p {margin-top: 30px;}" +
            "@media screen and (max-width: 600px) {.container {max-width: 100%;}}" +
            "</style></head><body><div class=\"container\"><h1>";

    public static final String T2 = "</h1><h2>";

    public static final String T3 = "验证邮件:</h2><p>请在 ";

    public static final String T4 = "内使用以下验证码验证您的电子邮件地址：</p><div class=\"code-container\"><div class=\"code\">";

    public static final String T5 = "</div></div><p class=\"info f-p\">若非您本人的操作请忽视此信息</p><p class=\"info\">这一封邮件包括一些您的账号信息，请不要回复或转发它，以免带来不必要的信息泄露风险。</p></div></body></html>";



    @Note("根据传入的参数生成邮箱验证码的 HTML 模板")
    public static String buildTemplate(String sendAlias, String actionName, String expiration, String captcha) {
        return T1 + sendAlias + T2 + actionName + T3 + expiration + T4 + captcha + T5;
    }


}
